package com.etc.patient.controller;

import com.etc.common.utils.Result;
import com.etc.patient.service.MedicalRecordService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/medicalRecord")
public class MedicalRecordController {
    @Resource
    private MedicalRecordService medicalRecordService;

    /**
     * 根据医生id模糊查询病人的病历
     */
    @RequestMapping("/queryByDocIdLike")
    public Result queryByDocIdLike(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize,
                                   @RequestParam("docId") String docId, @RequestParam("like") String like) {
        return medicalRecordService.queryByDocIdLike(pageNum, pageSize, docId, like);
    }

    /**
     * 根据医生id查询病人的病历
     *
     * @param docId
     * @return
     */
    @RequestMapping("/queryByDocId")
    public Result queryByDocId(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize,
                               @RequestParam("docId") String docId) {
        return medicalRecordService.queryByDocId(pageNum, pageSize, docId);
    }
}
